package com.song.shop.rabbitmq;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TopicSend {
	
	@Autowired
	private AmqpTemplate amqpTemplate ; 
	
	public void send() {
		String msg = "Topic message:"+new Date().getTime();
		this.amqpTemplate.convertAndSend("exchange", "topic.message", msg);
		System.out.println("---------Topic 消息已发送------------");
	}
}
